<template>
	<view class="">
		<view class="nav">
			<view class="cont" v-for="(item,index) in arr1" :key="index"
				@click="select(index,item.text,item.is_examine)" :class="currentindex==index?'conts':''">
				{{item.text}}
			</view>
		</view>

		<view class="" v-for="(item,index) in arr" :key="index">
			<view class="bigbox">
				<view class="time">
					{{item.time}}
				</view>
				<view class="listbox" v-for="(items,indexs) in item.houseList" :key="indexs" @click="particulars(items.id)">
					<view class="housename" >
						{{items.house_id.name || ''}}
					</view>
					<view class="ifobxo">
						<text class="room">{{items.house_id.room || '暂无'}}室</text>
						<text class="hall">{{items.house_id.hall || '暂无'}}厅</text>
						<text class="area">{{items.house_id.building_area || '暂无'}}㎡</text>
						<text class="orientation">{{items.house_id.orientation || '暂无'}}</text>
						<text class="plotname">{{items.house_id.community_name || '暂无'}}</text>
					</view>
					<view class="pricebox">
						<text class="pricename">成交价:</text>
						<text class="price">{{items.money || ''}}元</text>
					</view>
					<view class="clientbox">
						<text class="clientinfo">
							客户信息:
						</text>
						<text class="contant">{{items.guard_users_id.nickname || itemsitems.guard_users_id.name}}</text>
						<text class="contant_telephone">{{items.guard_users_id.phone || ''}}</text>
					</view>
					<view class="policebox" v-if="items.security_id.name">
						<image src="https://fangguaner.wm76.mtnet.ren/static/applet/jincha.png" mode=""
							class="policeimg">
						</image>
						<text class="policename">{{items.security_id.name || ''}}</text>
					</view>
					<view class="hr"></view>

					<view class="lastbox">
						<view class="brokerbox">
							<text>提交人:</text>
							<text class="brokername">{{items.agent_id.name}}</text>
						</view>
					</view>
					
				</view>
			</view>
			<view class="hrss"></view>
		</view>

	</view>


</template>

<script>
	import {
		usertransactionlist
	} from "../../api/api/index.js"
	export default {
		data() {
			return {
				limit: 8,
				page: 0,
				isOk: false,
				currentindex: 0,
				arr1: [{
					text: "待核实",
					is_examine: 0
				}, {
					text: "审核失败",
					is_examine: 2
				}, {
					text: "审核成功",
					is_examine: 1
				}],
				topshow: "待核实",
				is_examine: 0,
				arr: []
			}
		},
		methods: {
			select(index, item, examine) {
				this.currentindex = index
				this.is_examine = examine
				this.topshow = item
				this.isOk = false
				this.page = 0
				this.gethouselist()
			},
			gethouselist() {
				uni.showLoading({
					mask: true,
					title: '加载中'
				})
				let data = {
					is_examine: this.is_examine
				}
				usertransactionlist(data).then(res => {
					uni.hideLoading()
					let arr1 = []
					for (let k in res.data) {
						arr1.push({
							time: k,
							houseList: res.data[k]
						})
					}
					this.arr = arr1
					// this.arr = this.arr.concat(arr1)
				})
			},
			fail(item){
				this.jumpLink({
					link: "/pages/voucher/index",
					query: {
						guard_house_id: item.house_id.id,
						follow_up_id: item.follow_up_id,
						type: "fail",
						jiaoyi_id: item.id
					}
				})
			},
			// 凭证详情
			particulars(id){
				if(this.is_examine==2){
					this.jumpLink({link:"/pages/markparticulars/index",query:{id:id,genre:2}})
				}else{
					this.jumpLink({link:"/pages/markparticulars/index",query:{id:id,genre:0}})
				}
			}
		},
		onShow() {
			this.gethouselist()
		}
	}
</script>

<style scoped lang="less">
	.content {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
	}

	/* 头部导航 */
	.nav {
		display: flex;
		justify-content: space-between;
		padding: 20rpx 21rpx;
		box-sizing: border-box;
		width: 100%;
		background-color: #FFFFFF;
	}

	.cont {
		width: 300rpx;
		height: 54rpx;
		background-color: #FFFFFF;
		border-radius: 10rpx;
		font-size: 24rpx;
		line-height: 54rpx;
		text-align: center;
	}
	
	.clinchs{
		width: 200rpx;
		height: 61rpx;
		background-color: #ffffff;
		border-radius: 31rpx;
		border: solid 3rpx #df4744;
		font-family: MicrosoftYaHei;
		font-size: 26rpx;
		color: #df4744;
		line-height: 61rpx;
		text-align: center;
	}
	
	.conts {
		color: #FFFFFF;
		background-color: #E32D24;
	}

	.bigbox {
		padding: 10rpx 34rpx 35rpx 38rpx;
		box-sizing: border-box;

		.housename {
			font-family: MicrosoftYaHei-Bold;
			font-size: 28rpx;
			color: #282828;
			font-weight: 700;
			margin-bottom: 20rpx;

		}

		.ifobxo {
			font-family: MicrosoftYaHei;
			font-size: 22rpx;
			color: #878787;
			margin-bottom: 38rpx;

			text {
				margin-right: 10rpx;
			}
			.room{
				margin-right: 0;
			}
		}


		.pricebox {
			margin-bottom: 38rpx;

			.pricename {
				font-family: MicrosoftYaHei;
				font-size: 22rpx;
				color: #000000;
			}

			.price {
				font-family: PingFang-SC-Heavy;
				font-size: 23rpx;
				color: #e13c35;
				font-weight: 700;
				margin-left: 10rpx;
			}
		}

		.clientbox {
			.clientinfo {
				font-family: MicrosoftYaHei;
				font-size: 22rpx;
				color: #000000;
			}

			.contant {
				font-family: MicrosoftYaHei;
				font-size: 24rpx;
				color: #878787;
				margin-left: 10rpx;
			}

			.contant_telephone {
				font-family: MicrosoftYaHei;
				font-size: 24rpx;
				color: #878787;
				margin-left: 20rpx;
			}
		}

		.policebox {
			margin-left: 469rpx;
			display: flex;
			margin-top: 20rpx;
			align-items: center;

			image {
				width: 25rpx;
				height: 39rpx;
			}

			.policehouse {
				font-family: MicrosoftYaHei;
				font-size: 24rpx;
				color: #666666;
				margin-left: 15rpx;
			}

			.policename {
				font-family: MicrosoftYaHei;
				font-size: 24rpx;
				color: #666666;
				margin-left: 15rpx;
			}
		}

		.hr {
			width: 100%;
			height: 1rpx;
			background-color: #ededed;
			margin-top: 17rpx;
		}

		.lastbox {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 20rpx;
			box-sizing: border-box;

			.brokerbox {
				font-family: MicrosoftYaHei;
				font-size: 24rpx;
				color: #000000;

				.brokername {
					color: #666666;
					margin-left: 10rpx;
				}
			}

			.judgebox {
				.nopass {
					display: inline-block;
					width: 160rpx;
					height: 61rpx;
					background-color: #ffffff;
					border-radius: 31rpx;
					border: solid 3rpx #5f5f5f;
					color: #393939;
					font-family: MicrosoftYaHei;
					font-size: 26rpx;
					text-align: center;
					line-height: 61rpx;
					margin-right: 30rpx;
				}

				.pass {
					display: inline-block;
					width: 160rpx;
					height: 61rpx;
					background-color: #ffffff;
					border-radius: 31rpx;
					border: solid 3rpx #df4744;
					color: #d72f2c;
					font-family: MicrosoftYaHei;
					font-size: 26rpx;
					text-align: center;
					line-height: 61rpx;
				}
			}
		}

	}

	.hrss {
		width: 750rpx;
		height: 15rpx;
		background-color: #ededed;
		margin-top: -rpx;
	}

	.photobox {
		margin-top: 40rpx;
		display: flex;
		flex-wrap: wrap;
		align-items: center;

		.photo {
			margin-right: 10rpx;

			image {
				width: 150rpx;
				height: 150rpx;
				border-radius: 10rpx;
			}
		}
	}
	.time{
		margin-bottom: 20rpx;
	}
	.listbox{
		// margin-bottom: 40rpx;
		// border-radius: 10rpx;
		// border: 2rpx solid #CCCCCC;
		// padding: 10rpx;
		// box-sizing: border-box;
	}
</style>
